home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19970626-19970929
/
000268_news@newsmaster….columbia.edu _Sat Aug 30 18:20:26 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
3KB
Return-Path: <news@newsmaster.cc.columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id SAA07754
for <kermit.misc@watsun.cc.columbia.edu>; Sat, 30 Aug 1997 18:20:25 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id SAA08529
for kermit.misc@watsun; Sat, 30 Aug 1997 18:20:24 -0400 (EDT)
Path: news.columbia.edu!panix!cam-news-hub1.bbnplanet.com!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!cs.utexas.edu!news.cs.utah.edu!cc.usu.edu!jrd
From: jrd@cc.usu.edu (Joe Doupnik)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: Two problems with arrays in MS-DOS Kermit 3.15
Message-ID: <cJQy1iveLABq@cc.usu.edu>
Date: 30 Aug 97 15:37:54 MDT
References: <34085a7f.81052@news.calvacom.fr>
Organization: Utah State University
Lines: 61
Xref: news.columbia.edu comp.protocols.kermit.misc:7585
In article <34085a7f.81052@news.calvacom.fr>, do11@calva.net (Dominique Ottello) writes:
> Sorry, I don't want to take out a season-ticket to this group but.... ;-)
>
> I discovered two problems with arrays (\&<letter>[]) :
>
> First : declare \&e[0] does not empty the last element.
It does, but the last element is index value (array size - 1).
That is, like C, elements start with subscript/index 0.
> declare \&d[5]
Declares an array of five elements, \&d[0]..\&d[4].
> for \%i 1 5 1 {def \&d[\%i] No}
Does nothing with last element (out of bounds)
> for \%i 1 5 1 {echo \%i - (\&d[\%i])}
> ;
> echo {Element 4 and 5 must be empty with declare \\&d[0]}
> declare \&d[0]
> declare \&d[5]
> for \%i 1 3 1 {def \&d[\%i] Ys}
> for \%i 1 5 1 {echo \%i - (\&d[\%i])}
> ;
> echo {Element 5 is empty with def \\&d[5]}
> def \&d[5]
> for \%i 1 5 1 {echo \%i - (\&d[\%i])}
>
> Second : writing an empty array element into a file does very strange
> things and can crash the system
Yup, and that's another bug which was fixed in the previous message,
though not mentioned there.
> ; Save this into a take file myfile.tak
> ; Launch Kermit 3.15
> ; Type take myfile.tak
> ; and the system crash if the last element of the array is empty
> ;
> declare \&e[5]
> for \%i 1 4 1 {def \&e[\%i] No}
> open write file Test.dat
Syntax error: OPEN WRITE filename. Your filename is FILE here.
> write file \&e[1]\13\10
> write file \&e[2]\13\10
> write file \&e[3]\13\10
> write file \&e[4]\13\10
> write file \&e[5]\13\10
> close write-file
>
> Comments please.
>
> Best regards,
> == Dominique Ottello == do11@calva.net == Paris == France ==
Thanks, appreciated.
Joe D.